{% extends 'layout.html' %}
{# 继承模板 #}
{% block content %}

	<div class="container">
		<div style="margin-bottom: 10px">
			{#			target="_blank" 在新页面打开#}
			<a href="/depart/add/" class="btn btn-success">
				<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
				新建部门
			</a>
		</div>
		<div class="panel panel-default">
			<!-- Default panel contents -->
			<div class="panel-heading">
				<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
				批量上传
			</div>
			<div class="panel-body">
				<form method="post" enctype="multipart/form-data" action="/depart/multi/">
					{% csrf_token %}
					<div class="form-group">
						<input type="file" name="exc">
					</div>
					<input type="submit" value="上传" class="btn btn-info btn-sm">
				</form>
			</div>

		</div>

		<div class="panel panel-default">
			<!-- Default panel contents -->
			<div class="panel-heading">
				<span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
				部门列表
			</div>

			<!-- Table -->
			<table class="table table-bordered">
				<thead>
				<tr>
					<th>ID</th>
					<th>名称</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody>
				{% for obj in queryset %}
					<tr>
						<th>{{ obj.id }}</th>
						<td>{{ obj.title }}</td>
						<td>
							<a href="/depart/{{ obj.id }}/edit/" class="btn btn-primary btn-xs">编辑</a>
							<a href="/depart/{{ obj.id }}/delete/" class="btn btn-danger btn-xs">删除</a>
						</td>
					</tr>
				{% endfor %}
				</tbody>
			</table>
		</div>

		<ul class="pagination">
			{{ page_str }}
		</ul>
	</div>

{% endblock %}
